<?php

namespace LPCISII\PHP2012Bundle\Entity;
use Doctrine\ORM\Mapping as ORM;

/**
  * @ORM\Entity(repositoryClass="LPCISII\PHP2012Bundle\Repository\CategoriesRepository")
  * @ORM\Table(name="categories")
  * @ORM\HasLifecycleCallbacks()
  */
class Categories {
	
	/**
	  * @ORM\Id
	  * @ORM\Column(type="integer")
	  * @ORM\GeneratedValue(strategy="AUTO")
	  */
    protected $idCa;
	
	/**
	  * @ORM\Column(type="string")
	  */
	protected $nom;

        /**
          * @ORM\OneToMany(targetEntity="Articles", mappedBy="categorie")
          */
        protected $articles;
	
	public function getIdCa() {
		return $this->idCa;
	}
	
	public function setIdCa($idCa) {
		$this->idCa = $idCa;
	}

	public function getNom() {
        return $this->nom;
    }

    public function setNom($nom) {
        $this->nom = $nom;
    }
    public function __construct()
    {
        $this->articles = new \Doctrine\Common\Collections\ArrayCollection();
    }
    
    /**
     * Add articles
     *
     * @param LPCISII\PHP2012Bundle\Entity\Articles $articles
     */
    public function addArticles(\LPCISII\PHP2012Bundle\Entity\Articles $articles)
    {
        $this->articles[] = $articles;
    }

    /**
     * Get articles
     *
     * @return Doctrine\Common\Collections\Collection 
     */
    public function getArticles()
    {
        return $this->articles;
    }
    
    public function __toString() {
        return $this->nom;
    }
}